home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / picmanip / pic_r2z / stpm_pi3 / stpm_pi3.lst < prev    next >
File List  |  1995-05-05  |  4KB  |  189 lines

  1. '
  2. IF XBIOS(4)<>2                                   ! Check rez
  3.   ALERT 0,"Runs in Hi-rez Only!",1," OK ",f%     ! Alert for color
  4.   STOP                                           ! Exit
  5. ENDIF
  6. '
  7. CLS
  8. PRINT AT(17,3);"ST PrintMaster Graphics to DEGAS .PI3 Converter"
  9. PRINT AT(9,4);"A modifaction of PC PrintMaster Graphics to DEGAS .PI3 Converter"
  10. PRINT AT(20,5);"a freeware program by Larry D. Klotz."
  11. PRINT AT(12,6);"Modified to work with ST style PrintMaster graphics, print"
  12. PRINT AT(8,7);"graphics, preserve paths and autoname files by Bob Weidner 8/20/92"
  13. BOX 50,20,590,130
  14. DO
  15.   auto_name%=2
  16.   ALERT 2," | | Send screen images to printer ",1,"Yes|No",prt_it%
  17.   @open_lib
  18.   DO
  19.     @get_lib
  20.     INC ppage|
  21.     @save_pic
  22.     IF prt_it%=1
  23.       @prt_screen
  24.     ENDIF
  25.   LOOP UNTIL (EOF(#1)) OR (LOC(#1)>lf%-20)
  26.   CLOSE #1
  27.   ALERT 2,"Conversion complete.|Do another?",1,"Yes|No/Quit",d%
  28.   b1$=""
  29.   ppage|=0
  30.   IF d%=2
  31.     CLOSE #1
  32.     STOP
  33.   ENDIF
  34. LOOP
  35. '
  36. PROCEDURE open_lib
  37.   '
  38.   CLS
  39.   IF b$=""
  40.     b$=".SHP"
  41.     cf$="\"
  42.   ENDIF
  43.   PRINT CHR$(27);"p";
  44.   PRINT AT(14,1);"  Load ST PrintMaster Library to Convert  (.SHP file)  "
  45.   PRINT CHR$(27);"q";
  46.   FILESELECT cf$+"*.SHP",b$,shapefile$
  47.   cf=RINSTR(shapefile$,"\")
  48.   cf$=LEFT$(shapefile$,cf)
  49.   b$=RIGHT$(shapefile$,LEN(shapefile$)-cf)
  50.   '
  51.   IF shapefile$=""
  52.     STOP
  53.   ENDIF
  54.   '
  55.   CLOSE #1
  56.   OPEN "I",#1,shapefile$
  57.   lf%=LOF(#1)
  58.   '
  59. RETURN
  60. '
  61. PROCEDURE get_lib
  62.   '
  63.   CLS
  64.   '
  65.   FOR g_row|=0 TO 6
  66.     FOR g_col|=0 TO 5
  67.       '
  68.       DO
  69.         IF EOF(#1)
  70.           g_row|=6
  71.           g_col|=5
  72.           b|=&HB
  73.         ELSE
  74.           b|=INP(#1)
  75.         ENDIF
  76.       LOOP UNTIL b|=&HB
  77.       DO
  78.         IF EOF(#1)
  79.           g_row|=6
  80.           g_col|=5
  81.           b|=&H34
  82.         ELSE
  83.           b|=INP(#1)
  84.         ENDIF
  85.       LOOP UNTIL b|=&H34
  86.       DO
  87.         IF EOF(#1)
  88.           g_row|=6
  89.           g_col|=5
  90.           b|=0
  91.         ELSE
  92.           b|=INP(#1)
  93.         ENDIF
  94.       LOOP UNTIL b|=0
  95.       DO
  96.         IF EOF(#1)
  97.           g_row|=6
  98.           g_col|=5
  99.           b|=&H58
  100.         ELSE
  101.           b|=INP(#1)
  102.         ENDIF
  103.       LOOP UNTIL b|=&H58
  104.       '
  105.       FOR x|=0 TO 51
  106.         IF EOF(#1)
  107.           x|=51
  108.         ELSE IF lf%-LOC(#1)<858
  109.           FOR p|=0 TO 10
  110.             IF EOF(#1)
  111.               p|=10
  112.               x|=51
  113.             ELSE
  114.               BGET #1,XBIOS(2)+p|+(x|*80)+321+(g_row|*(55*80))+(g_col|*13),1
  115.             ENDIF
  116.           NEXT p|
  117.         ELSE
  118.           BGET #1,XBIOS(2)+(x|*80)+321+(g_row|*(55*80))+(g_col|*13),11
  119.         ENDIF
  120.       NEXT x|
  121.       '
  122.     NEXT g_col|
  123.   NEXT g_row|
  124.   '
  125. RETURN
  126. '
  127. PROCEDURE save_pic
  128.   IF b1$=""
  129.     b1$=b$
  130.   ENDIF
  131.   cf1=RINSTR(b1$,".")-1
  132.   IF cf1>7
  133.     cf1=7
  134.   ENDIF
  135.   b1$=LEFT$(b1$,cf1)+CHR$(48+ppage|)+".PI3"
  136.   SGET screen$
  137.   '
  138. n_again:
  139.   IF auto_name%<>1
  140.     PRINT CHR$(27);"p";
  141.     PRINT AT(3,1);" Select destination drive and a file name (suggested file name is provided) ";
  142.     PRINT CHR$(27);"q";
  143.     FILESELECT cf1$+"*.PI3",b1$,outfile$
  144.     '
  145.     cf3=RINSTR(outfile$,"\")
  146.     npath$=LEFT$(outfile$,cf3)
  147.     fname$=RIGHT$(outfile$,LEN(outfile$)-cf3)
  148.     cf4=RINSTR(fname$,".")
  149.     IF cf4
  150.       fname$=LEFT$(fname$,cf4-1)
  151.     ENDIF
  152.     IF (b1$<>fname$+".PI3") AND (LEN(fname$)<8)
  153.       fname$=fname$+CHR$(48+ppage|)
  154.     ENDIF
  155.     outfile$=npath$+fname$+".PI3"
  156.     '
  157.     ALERT 2,"Name .PI3 files automatically?| |(Same name files| will not be overwritten)",1,"Yes|No",auto_name%
  158.   ELSE
  159.     MID$(outfile$,LEN(outfile$)-4,1)=CHR$(48+ppage|)
  160.   ENDIF
  161.   IF EXIST(outfile$)
  162.     ALERT 1,"A file with that name exists.| | |     Overwrite file? ",2,"YES|NO",fx%
  163.     IF fx%=2
  164.       auto_name%=2
  165.       GOTO n_again
  166.     ENDIF
  167.   ENDIF
  168.   cf1=RINSTR(outfile$,"\")
  169.   cf1$=LEFT$(outfile$,cf1)
  170.   b1$=RIGHT$(outfile$,LEN(outfile$)-cf1)
  171.   '
  172.   SPUT screen$
  173.   CLOSE #2
  174.   OPEN "O",#2,outfile$
  175.   OUT #2,0,2,7,&H77,0,0,6,&H66,6,&H66,5,&H55,5,&H55,4,&H44,4,&H44,3,&H33
  176.   OUT #2,3,&H33,2,&H22,2,&H22,1,&H11,1,&H11,0,0,0,0
  177.   BPUT #2,XBIOS(2),32000
  178.   CLOSE #2
  179.   '
  180. RETURN
  181. PROCEDURE prt_screen
  182.   LPRINT "   Name of file... ";b1$
  183.   LPRINT
  184.   LPRINT
  185.   LPRINT
  186.   HARDCOPY
  187.   LPRINT CHR$(12);
  188. RETURN
  189.